The Chameleon-\/\-Mini enumerates as a C\-D\-C-\/\-A\-C\-M virtual serial interface. For a high level of compatibility to be both interfaced by a human as well as a user application, it supports a text-\/based command line, which can be accessed by using simple terminal software like hyper-\/terminal or teraterm. The serial settings, as in baudrate, stopp and parity bits are ignored on the Chameleon side. Note that there is no echo of entered characters at the Chameleon.

\section*{Command structure }

Each of the following commands can result into 3 actions, depending on the character that is appended to it.
\begin{DoxyItemize}
\item {\ttfamily $<$C\-O\-M\-M\-A\-N\-D$>$?}\-: Indicates a request that will always return an information
\item {\ttfamily $<$C\-O\-M\-M\-A\-N\-D$>$=$<$V\-A\-L\-U\-E$>$}\-: Indicates to set a value on the Chameleon
\item {\ttfamily $<$C\-O\-M\-M\-A\-N\-D$>$}\-: Indicates to execute a procedure on the Chameleon with an optional response
\end{DoxyItemize}

Note that some commands only support a subset of these 3 actions.

In order to perform the desired command action the command has to be suffixed with a carriage return (C\-R, 0\-D hexadecimal). In order to be more user-\/friendly when interfacing the Chameleon with a serial terminal, support for the backspace (08 hexadecimal) and escape (1\-B hexadecimal) key have been added. Any other control character as defined in the A\-S\-C\-I\-I character set is ignored. Furthermore the Chameleon does not distinguish between uppercase and lowercase.

\section*{Supported Commands }

The following list shows the supported commands and how they are used. \begin{TabularC}{2}
\hline
\rowcolor{lightgray}{\bf Command }&{\bf Description  }\\\cline{1-2}
{\ttfamily V\-E\-R\-S\-I\-O\-N?} &Requests the version of the Chameleon \\\cline{1-2}
{\ttfamily R\-E\-S\-E\-T} &Resets the Chameleon \\\cline{1-2}
{\ttfamily U\-P\-G\-R\-A\-D\-E} &Sets the Chameleon into firmware upgrade mode (D\-F\-U) \\\cline{1-2}
{\ttfamily C\-O\-N\-F\-I\-G} &Returns a comma-\/separated list of all supported configurations \\\cline{1-2}
{\ttfamily C\-O\-N\-F\-I\-G?} &Returns the currently used configuration \\\cline{1-2}
{\ttfamily C\-O\-N\-F\-I\-G=$<$N\-A\-M\-E$>$} &Sets the current configuration to {\ttfamily $<$N\-A\-M\-E$>$} (See Page\-\_\-\-Configurations) \\\cline{1-2}
{\ttfamily U\-I\-D\-S\-I\-Z\-E?} &Returns the size of the current configuration's U\-I\-D \\\cline{1-2}
{\ttfamily U\-I\-D?} &Returns the currently set U\-I\-D \\\cline{1-2}
{\ttfamily U\-I\-D=$<$U\-I\-D$>$} &Sets a new U\-I\-D to be used in hexadecimal notation \\\cline{1-2}
{\ttfamily R\-E\-A\-D\-O\-N\-L\-Y?} &Returns the current state of the read-\/only mode \\\cline{1-2}
{\ttfamily R\-E\-A\-D\-O\-N\-L\-Y=\mbox{[}0;1\mbox{]}} &Activates or deactivates the read-\/only mode (Any writing to the memory is silently ignored) \\\cline{1-2}
{\ttfamily M\-E\-M\-S\-I\-Z\-E?} &Returns the memory size of the current configuration \\\cline{1-2}
{\ttfamily U\-P\-L\-O\-A\-D} &Waits for an X\-Modem connection to be established in order to upload a memory dump upto the memory size \\\cline{1-2}
{\ttfamily D\-O\-W\-N\-L\-O\-A\-D} &Waits for an X\-Modem connection to be established in order to download a memory dump with exactly the memory size \\\cline{1-2}
{\ttfamily B\-U\-T\-T\-O\-N} &Returns a comma-\/separated list of supported button press actions for the button \\\cline{1-2}
{\ttfamily B\-U\-T\-T\-O\-N?} &Returns the currently set button press action for B\-U\-T\-T\-O\-N0 \\\cline{1-2}
{\ttfamily B\-U\-T\-T\-O\-N=$<$N\-A\-M\-E$>$} &Sets the current button press action for B\-U\-T\-T\-O\-N0 \\\cline{1-2}
{\ttfamily S\-E\-T\-T\-I\-N\-G?} &Returns the currently activated setting of the chameleon-\/mini \\\cline{1-2}
{\ttfamily S\-E\-T\-T\-I\-N\-G=$<$N\-U\-M\-B\-E\-R$>$} &Sets the active setting of the chameleon-\/mini \\\cline{1-2}
{\ttfamily C\-L\-E\-A\-R} &Clears the entire memory of the currently activated setting \\\cline{1-2}
\end{TabularC}
\section*{Responses }

Subsequent to A\-N\-Y send command, the Chameleon responds with a status number and status message, separated by a colon and terminated with a carriage return and line feed (C\-R+\-L\-F, 0\-D+0\-A hexadecimal). Status numbers are of a 3 digit decimal format with the first digit showing the severity of the answer. Status numbers beginning with a '1' denote an informational item and those beginning with a '2' denote an error. \begin{TabularC}{2}
\hline
\rowcolor{lightgray}{\bf Response }&{\bf Description  }\\\cline{1-2}
{\ttfamily 100\-:O\-K} &The command executed successfully \\\cline{1-2}
{\ttfamily 101\-:O\-K W\-I\-T\-H T\-E\-X\-T} &The command executed successfully and this answer is appended with an additional line of information, terminated with C\-R+\-L\-F \\\cline{1-2}
{\ttfamily 110\-:W\-A\-I\-T\-I\-N\-G F\-O\-R X\-M\-O\-D\-E\-M} &The Chameleon is waiting for an X\-M\-O\-D\-E\-M connection to establish \\\cline{1-2}
{\ttfamily 200\-:U\-N\-K\-N\-O\-W\-N C\-O\-M\-M\-A\-N\-D} &This command is unknown to the Chameleon \\\cline{1-2}
{\ttfamily 201\-:I\-N\-V\-A\-L\-I\-D C\-O\-M\-M\-A\-N\-D U\-S\-A\-G\-E} &This action is not supported by this command \\\cline{1-2}
{\ttfamily 202\-:I\-N\-V\-A\-L\-I\-D P\-A\-R\-A\-M} &The format or value of the given parameter value is invalid \\\cline{1-2}
\end{TabularC}
\section*{Accessing the command-\/line using a terminal software }

In order to have quick access to the Chameleon's command-\/line without using any complicated software, we suggest using the Tera\-Term terminal emulation software available for windows based operating systems.

\subsection*{Connecting and setting up }

For establishing a connection to the Chameleon's command line, select File -\/$>$ New Connection, choose the virtual serial port of the Chameleon and hit the \char`\"{}\-O\-K\char`\"{} button. Tera\-Term now tries to open the serial port and should succeed without any error.

For easier use of the command-\/line using a terminal software the local-\/echo functionality should be activated, to be able to see what is typed into the chameleon. When using Tera\-Term, this can be achieved by selecting Setup -\/$>$ Terminal and check \char`\"{}\-Local Echo\char`\"{}.

\subsection*{Uploading and Downloading dump files }

In some configurations of the Chameleon, it is necessary to upload a card dump before it can be accessed by a reader. For doing so, the relatively simple and widely known X\-M\-O\-D\-E\-M protocol is used.

To upload a dump file using Tera\-Term, follow these steps.
\begin{DoxyEnumerate}
\item Enter {\ttfamily U\-P\-L\-O\-A\-D} and wait for the {\ttfamily 110\-:W\-A\-I\-T\-I\-N\-G F\-O\-R X\-M\-O\-D\-E\-M} response
\item Select File -\/$>$ Transfer -\/$>$ X\-M\-O\-D\-E\-M -\/$>$ Send
\item In the dialog choose the binary dumpfile to be uploaded and make sure the option \char`\"{}\-Checksum\char`\"{} is checked in the lower left corner
\item Hitting the \char`\"{}\-Open\char`\"{} button will start the transfer. If no error is given to the user, the file has been uploaded sucessfully.
\end{DoxyEnumerate}

To download the Chameleon's memory again, follow the instructions above except for using {\ttfamily D\-O\-W\-N\-L\-O\-A\-D} instead of {\ttfamily U\-P\-L\-O\-A\-D} and the Receive function of Tera\-Term

Note that there is a 10 second timeout after entering {\ttfamily U\-P\-L\-O\-A\-D} respectively {\ttfamily D\-O\-W\-N\-L\-O\-A\-D} after which the standard command-\/line is activated again. So try again if the timeout is already over when the X\-M\-O\-D\-E\-M transfer is about to start. 